Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webgpu update #16184

Merged
merged 9 commits into from
Sep 8, 2023
Merged

webgpu update #16184

merged 9 commits into from
Sep 8, 2023

Conversation

hana-alice
Copy link
Contributor

Re: # cocos/cocos-engine-external#417

Changelog

webgpu update:

  • several const cast exist for lazy instantiation of descriptor set layout;
  • add access flag for storage buffer distinguishing read-only access and write read-write access
  • update emscripten sdk to latest(3.1.45)

Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Interface Check Report

This pull request does not change any public interfaces !

@@ -54,7 +54,7 @@ void CCWGPUBuffer::doInit(const BufferInfo &info) {
_gpuBufferObject->indirectObjs.resize(drawInfoCount);
}

_size = ceil(info.size / 4.0) * 4;
_size = ceil(info.size / 16.0) * 16;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using boost::alignment::align_up or (size + (n - 1)) / n * n to avoid double conversion, which might introduce precision problem.

@@ -446,7 +437,7 @@ void CCWGPUCommandBuffer::bindStates() {
if (indexBuffer) {
wgpuRenderPassEncoderSetIndexBuffer(_gpuCommandBufferObj->wgpuRenderPassEncoder,
indexBuffer->gpuBufferObject()->wgpuBuffer,
indexBuffer->getStride() == 2 ? WGPUIndexFormat::WGPUIndexFormat_Uint16 : WGPUIndexFormat_Uint32,
indexBuffer->getStride() <= 2 ? WGPUIndexFormat::WGPUIndexFormat_Uint16 : WGPUIndexFormat_Uint32,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might assert(indexBuffer->getStride() >= 2). I am not sure whether we can handle stride < 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think I must have met uint8 array as an index buffer, shall we make all index buffer a u16array or a u32array?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We can only use u16array or u32array, if it is possible.

@hana-alice hana-alice mentioned this pull request Sep 7, 2023
6 tasks
@hana-alice hana-alice closed this Sep 8, 2023
@hana-alice hana-alice reopened this Sep 8, 2023
@star-e star-e merged commit 91ce03d into cocos:v3.8.2 Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants